2.1 Find metabolites in the database ======================================== .. code:: ipython3 from marsi.io.db import Metabolite, Reference, Database .. parsed-literal:: Looking for local setup.cfg Not available [Errno 2] No such file or directory: 'setup.cfg' .. parsed-literal:: /Users/joaca/Documents/repositories/marsi/marsi/chemistry/rdkit.py:25: DeprecationWarning: The rdkit.Chem.MCS module is deprecated; please use rdkit.Chem.rdFMCS instead. from rdkit.Chem import AllChem, MACCSkeys, MCS .. code:: ipython3 len(Database.metabolites) :: --------------------------------------------------------------------------- TypeError Traceback (most recent call last) in () ----> 1 len(Database.metabolites) TypeError: 'result' object cannot be interpreted as an integer Metabolites are indexed using InChI key. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ For example: 1. 2-Deoxy-Glucose: PMMURAAUARKVCB-CERMHHMHSA-N-D 2. Norvaline: SNDPXSYFESPGGJ-SCSAIBSYSA-N .. code:: ipython3 Metabolite.get('PMMURAAUARKVCB-CERMHHMHSA-N') .. raw:: html
FormulaC6H12O5
InChiInChI=1S/C6H12O5/c7-2-4-6(10)3(8)1-5(9)11-4/h3-10H,1-2H2/t3-,4-,5?,6+/m1/s1
InChi KeyPMMURAAUARKVCB-CERMHHMHSA-N
Structure - Open Babel Depiction O OH OH HO OH
DBsdrugbank: DB08831
Synonyms2-Deoxy-D-arabino-hexose
.. code:: ipython3 Metabolite.get('SNDPXSYFESPGGJ-SCSAIBSYSA-N') .. raw:: html
FormulaC5H11NO2
InChiInChI=1S/C5H11NO2/c1-2-3-4(6)5(7)8/h4H,2-3,6H2,1H3,(H,7,8)/t4-/m1/s1
InChi KeySNDPXSYFESPGGJ-SCSAIBSYSA-N
Structure - Open Babel Depiction CH 3 O HO NH 2
DBszinc: ZINC00391822
Synonyms
The query can also be done using identifiers from databases ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References are not indexed so this can be very slow. .. code:: ipython3 ref = Reference.get(accession="ZINC00391822", database="zinc") .. code:: ipython3 ref.id .. parsed-literal:: 3004454 .. code:: ipython3 mets = Metabolite.from_references(references=[ref]) .. code:: ipython3 mets[0] .. raw:: html
FormulaC5H11NO2
InChiInChI=1S/C5H11NO2/c1-2-3-4(6)5(7)8/h4H,2-3,6H2,1H3,(H,7,8)/t4-/m1/s1
InChi KeySNDPXSYFESPGGJ-SCSAIBSYSA-N
Structure - Open Babel Depiction CH 3 O HO NH 2
DBszinc: ZINC00391822
Synonyms